﻿Imports DevComponents.DotNetBar
Imports DevComponents.DotNetBar.Rendering
Imports BUS
Imports DTO

Public Class frmMainMenu : Inherits DevComponents.DotNetBar.Office2007RibbonForm


    Private Sub MainTab_TabItemClose(ByVal sender As System.Object, ByVal e As DevComponents.DotNetBar.TabStripActionEventArgs) Handles MainTab.TabItemClose
        Dim t As TabItem = MainTab.SelectedTab
        MainTab.Tabs.Remove(t)
        t.Dispose()
    End Sub

    Private Function CheckExists(ByVal _tabName As String) As Integer
        Dim re As Integer = -1
        For i = 0 To MainTab.Tabs.Count - 1
            If MainTab.Tabs(i).Name = _tabName Then
                re = i
                Exit For
            End If
        Next
        Return re
    End Function

    Private Sub CreateTab(ByVal _name As String, ByVal _text As String, ByVal _form As Office2007Form)
        Dim index As Integer = CheckExists(_name)
        If (index > -1) Then
            MainTab.SelectedTab = MainTab.Tabs(index)
        Else
            Dim tap As TabItem = MainTab.CreateTab(_text)
            tap.Name = _name

            _form.TopLevel = False
            _form.Dock = DockStyle.Fill
            tap.AttachedControl.Controls.Add(_form)
            _form.Show()
            MainTab.SelectedTabIndex = MainTab.Tabs.Count - 1
        End If
    End Sub


    Private Sub ButtonItemMaximum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemMaximum.Click
        Me.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ButtonItemMinimum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemMinimum.Click
        Me.WindowState = FormWindowState.Minimized
    End Sub

    Private Sub ButtonItemThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemThoat.Click
        Application.Exit()
    End Sub

    Private m_ColorSelected As Boolean = False
    Private m_BaseColor As eOffice2007ColorScheme = eOffice2007ColorScheme.Blue

    Private Sub ColorPickerDropDownMau_ExpandChange(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ColorPickerDropDownMau.ExpandChange
        If (ColorPickerDropDownMau.Expanded) Then
            m_ColorSelected = True
            m_BaseColor = DirectCast(GlobalManager.Renderer, Office2007Renderer).ColorTable.InitialColorScheme
            If Not m_ColorSelected Then
                RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(Me, m_BaseColor)
            End If
        End If
    End Sub

    Private Sub ColorPickerDropDownMau_SelectedColorChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ColorPickerDropDownMau.SelectedColorChanged
        If m_ColorSelected = True Then
            ' RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(Me, m_BaseColor, ColorPickerDropDownMau.SelectedColor)
            StyleManager1.ManagerColorTint = ColorPickerDropDownMau.SelectedColor
        End If
    End Sub

    Private Sub btnMuon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMuon.Click
        Dim frm As New frmChoMuonSach()
        CreateTab("frmChoMuonSach1", "Cho mượn sách", frm)
    End Sub

    Private Sub btnTra_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTra.Click
        Dim frm As New frmTraSach()
        CreateTab("frmTraSach", "Trả sách", frm)
    End Sub

    Private Sub btnPhieuThu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPhieuThu.Click
        Dim frm As New frmPhieuThuTienPhat()
        frm.NhanVien = m_nhanvien
        CreateTab("frmPhieuThuTienPhat", "Phiếu thu tiền phạt", frm)
    End Sub

    Private Sub btnThe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThe.Click
        Dim frm As New frmLapTheDocGia()
        frm.NhanVien = m_nhanvien
        CreateTab("frmLapTheDocGia", "Lập thẻ độc giả", frm)
    End Sub

    Private Sub btnThanhLySach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThanhLySach.Click
        Dim frm As New frmThanhLySach()
        frm.NhanVien = m_nhanvien
        CreateTab("frmThanhLySach", "Thanh lý sách", frm)
    End Sub

    Private Sub btnNhanVien_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNhanVien.Click
        Dim frm As New frmThemNhanVien()
        CreateTab("frmThemNhanVien", "Thêm Nhân Viên", frm)
    End Sub

    Private Sub btnGhiNhanMatSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGhiNhanMatSach.Click
        Dim frm As New frmGhiNhanMatSach()
        frm.NhanVien = m_nhanvien
        CreateTab("frmGhiNhanMatSach", "Ghi Nhận Mất Sách", frm)
    End Sub

    Private Sub btnGiaHanThe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGiaHanThe.Click
        Dim frm As New frmGiaHanThe()
        CreateTab("frmGiaHanThe", "Gia Hạn Thẻ", frm)
    End Sub

    Private Sub btnTimKiemDauSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimKiemDauSach.Click
        Dim frm As New frmTraCuuSach()
        CreateTab("frmTraCuuSach", "Tra Cứu Sách", frm)
    End Sub

    Private Sub btnTimKiemDocGia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimKiemDocGia.Click
        Dim frm As New frmTraCuuDocGia()
        CreateTab("frmTraCuuDocGia", "Tra Cứu Độc Giả", frm)
    End Sub

    Private Sub ButtonItemTheoDocGia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim frm As New frmGhiNhanMatSach()
        CreateTab("frmTimPhieuMuonTheoMaDocGia", "Tìm Phiếu Mượn Theo Độc Giả", frm)
    End Sub

    Private Sub btnDauSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDauSach.Click
        Dim frm As New frmTiepNhanDauSach()
        frm.NhanVien = m_nhanvien
        CreateTab("frmTiepNhanDauSach", "Tiếp nhận đầu sách", frm)
    End Sub

    Private Sub btnTKSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub btnSaoluu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaoluu.Click
        Dim spf As New SaveFileDialog()
        spf.Filter = "(*.bak)|*.bak"
        spf.InitialDirectory = Application.StartupPath
        spf.DefaultExt = ".bak"
        spf.Title = "Chọn đường dẫn để lưu"
        spf.CheckFileExists = False

        If spf.ShowDialog() = DialogResult.OK Then
            Dim fn As New IO.FileInfo(spf.FileName)

            Dim frm As New frmBackup()
            frm.FilePath = spf.FileName
            frm.FileName = fn.Name.Substring(0, fn.Name.LastIndexOf("."c))
            frm.Show()
            frm.Run()
            frm.Dispose()
        End If
    End Sub

    Private Sub btnPhucHoi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPhucHoi.Click
        Dim opf As New OpenFileDialog()
        opf.Filter = "(*.bak)|*.bak"
        opf.InitialDirectory = Application.StartupPath
        opf.DefaultExt = ".bak"
        opf.Multiselect = False
        opf.Title = "Chọn tập tin cần phục hồi"
        opf.CheckFileExists = True
        opf.AddExtension = True
        If opf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmRestore()
            frm.FilePath = opf.FileName
            frm.Show()
            frm.PhucHoi()
        End If
    End Sub

    Private Sub ButtonItemOffice2007Blue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemOffice2007Blue.Click
        StyleManager1.ManagerStyle = eStyle.Office2007Black
    End Sub

    Private Sub ButtonItemOffice2007Silver_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemOffice2007Silver.Click
        StyleManager1.ManagerStyle = eStyle.Office2007Blue
    End Sub

    Private Sub ButtonItemOfice2007Black_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemOfice2007Black.Click
        StyleManager1.ManagerStyle = eStyle.Office2007Silver
    End Sub

    Private Sub ButtonItemOfice2007VistaGlass_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemOfice2007VistaGlass.Click
        StyleManager1.ManagerStyle = eStyle.Office2007VistaGlass
    End Sub

    Private Sub ButtonItemOffice2010Silver_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemOffice2010Silver.Click
        StyleManager1.ManagerStyle = eStyle.Office2010Black
    End Sub

    Private Sub ButtonItemOffice2010Blue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemOffice2010Blue.Click
        StyleManager1.ManagerStyle = eStyle.Office2010Blue
    End Sub

    Private Sub ButtonItemOffice2010Black_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemOffice2010Black.Click
        StyleManager1.ManagerStyle = eStyle.Office2010Silver
    End Sub

    Private Sub ButtonItemWindows7Blue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemWindows7Blue.Click
        StyleManager1.ManagerStyle = eStyle.Windows7Blue
    End Sub

    Private Sub ButtonItemExportExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemExportExcel.Click
        Dim spf As New SaveFileDialog()
        spf.Filter = "(*.xlsx)|*.xlsx"
        spf.InitialDirectory = Application.StartupPath
        spf.DefaultExt = ".xlsx"
        spf.Title = "Chọn đường dẫn để lưu"
        spf.CheckFileExists = False
        If spf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmExportExcel()
            frm.FilePath = spf.FileName
            frm.Show()
            If (frm.ExportAllTableToExcel() = Windows.Forms.DialogResult.OK) Then
                frm.Dispose()
            End If
        End If
    End Sub

    Private Sub btnCapNhatSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapNhatSach.Click
        Dim frm As New frmCapNhatSach()
        CreateTab("frmCapNhatSach", "Cập nhật sách", frm)
    End Sub
    Private m_nhanvien As CNhanVienDTO

    Private Sub PhanQuyen()

        Dim dto As CQuyenTheoBoPhanDTO = New CQuyenTheoBoPhanBUS().LayQuyenTheoBoPhan(m_nhanvien.MaBoPhan)
        RibbonBarMuonTraSach.Visible = dto.RibbonBarMuonTraSach
        RibbonBarQuanLySach.Visible = dto.RibbonBarQuanLySach
        RibbonBarTheThuVien.Visible = dto.RibbonBarTheThuVien
        RibbonBarThuTienPhat.Visible = dto.RibbonBarThuTienPhat
        RibbonBarTimKiemTheoSach.Visible = dto.RibbonBarTimKiemTheoSach
        RibbonBarTimKiemTheoDocGia.Visible = dto.RibbonBarTimKiemTheoDocGia
        btnBCMuonTheoTheLoai.Visible = dto.RibbonButtonBaoCaoMuonTheoTheLoai
        btnBCSachTraTre.Visible = dto.RibbonButtonBaoCaoSachTraTre
        btnBaoCaoDocGiaNoTienPhat.Visible = dto.RibbonButtonBaoCaoDocGiaNoTienPhat
    End Sub
    Private Sub NhomQuyen()
        Dim quyen As CQuyenDTO = New CQuyenBUS().LayQuyen(m_nhanvien.MaQuyenHan)
        RibbonBarDuLieu.Visible = quyen.RibbonBarDuLieu
        RibbonBarMuonTraSach.Visible = quyen.RibbonBarMuonTraSach
        RibbonBarThuTienPhat.Visible = quyen.RibbonBarThuTienPhat
        RibbonBarNhanVien.Visible = quyen.RibbonBarNhanVien
        RibbonBarTheThuVien.Visible = quyen.RibbonBarTheThuVien
        RibbonBarTimKiemTheoSach.Visible = quyen.RibbonBarTimKiemTheoSach
        RibbonBarTimKiemTheoDocGia.Visible = quyen.RibbonBarTimKiemTheoDocGia
        RibbonBarTinhHinhChoMuonSach.Visible = quyen.RibbonBarTinhHinhChoMuonSach
        RibbonTabItemAdmin.Visible = quyen.RibbonTabIemAdmin
        RibbonBarQuanLySach.Visible = quyen.RibbonBarQuanLySach
        RibbonTabItemBlackAdmin.Visible = quyen.RibbonTabItemBlackAdmin
    End Sub

    Private Sub frmMainMenu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Visible = False
        Dim frm As New frmLogOn()
        If (frm.ShowDialog() = Windows.Forms.DialogResult.OK) Then
            m_nhanvien = frm.TenDangNhap
            Me.Visible = True
            NhomQuyen()
            PhanQuyen()
        Else
            Application.Exit()
        End If
    End Sub

    Private Sub btnBangCap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBangCap.Click
        Dim frm As New frmCapNhatBangCap()
        CreateTab("frmCapNhatBangCap", "Cập nhật bằng cấp", frm)
    End Sub

    Private Sub btnTheLoai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTheLoai.Click
        Dim frm As New frmCapNhatBangTheLoaiSach()
        CreateTab("frmCapNhatTheLoaiSach", "Cập nhật thể loại sách", frm)
    End Sub

    Private Sub btnBoPhan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBoPhan.Click
        Dim frm As New frmCapNhatBoPhan()
        CreateTab("frmCapNhatboPhan", "Cập nhật bộ phận", frm)
    End Sub

    Private Sub btnChucVu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChucVu.Click
        Dim frm As New frmCapNhatChucVu()
        CreateTab("frmCapNhatChucVu", "Cập nhật Chức vụ", frm)
    End Sub

    Private Sub btnLoaiDocGia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoaiDocGia.Click
        Dim frm As New frmCapNhatLoaiDocGia()
        CreateTab("frmCapNhatLoaiDocGia", "Cập nhật loại độc giả", frm)
    End Sub

    Private Sub btnLyDoThanhLy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLyDoThanhLy.Click
        Dim frm As New frmCapNhatLyDoThanhLy()
        CreateTab("frmCapNhatlydothanhly", "Cập nhật lý do thanh lý", frm)
    End Sub

    Private Sub btnThongTinNhanVien_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThongTinNhanVien.Click
        Dim frm As New frmCapNhatTinhTrangNhanVien()
        CreateTab("frmCapNhatTinhTrangNhanvien", "Cập nhật tình trạng nhân viên", frm)
    End Sub

    Private Sub btnTinhTrangChiTietPhieuMuon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTinhTrangChiTietPhieuMuon.Click
        Dim frm As New frmCapNhatTinhTrangChiTietPhieuMuon()
        CreateTab("frmCapNhatTinhTrangChiTietPhieuMuon", "Cập nhật tình trạng chi tiết phiếu mượn", frm)
    End Sub

    Private Sub btnTinhTrangPhieuMuon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTinhTrangPhieuMuon.Click
        Dim frm As New frmCapNhatTinhTrangPhieuMuon()
        CreateTab("frmCapNhatTinhTrangPhieuMuon", "Cập nhật tình trạng phiếu mượn", frm)
    End Sub

    Private Sub btnTinhTrangSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim frm As New frmCapNhatTinhTrangDauSach()
        CreateTab("frmCapNhatTinhTrangDauSach", "Cập nhật tình trạng đầu sách", frm)
    End Sub

    Private Sub btnThamSo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThamSo.Click
        Dim frm As New frmCapNhatBangThamSo()
        CreateTab("frmCapNhatThamSo", "Cập nhật tham số", frm)
    End Sub

    Private Sub ButtonItemThayDoiMatKhau_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemThayDoiMatKhau.Click
        Dim frm As New frmThayDoiMatKhau()
        frm.NhanVien = m_nhanvien
        CreateTab("frmThayDoiMatKhau", "Thay đổi mật khẩu", frm)
    End Sub

    Private Sub btnBCMuonTheoTheLoai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBCMuonTheoTheLoai.Click
        Dim frm As New frmBaoCaoThongKeTinhHinhChoMuonSachTheoTheLoai()
        frm.NhanVien = m_nhanvien
        CreateTab("frmBaoCaoThongKeTinhHinhChoMuonSachTheoTheLoai", "Cho mượn sách theo thể loại", frm)
    End Sub

    Private Sub btnBCSachTraTre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBCSachTraTre.Click
        Dim frm As New frmBaoCaoThongKeSachTraTre()
        frm.NhanVien = m_nhanvien
        CreateTab("frmBaoCaoThongKeSachTraTre", "Báo cáo thống kê sách trả trễ", frm)
    End Sub

    Private Sub btnBaoCaoDocGiaNoTienPhat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBaoCaoDocGiaNoTienPhat.Click
        Dim frm As New frmBaoCaoThongKeDocGiaNoTienPhat()
        frm.NhanVien = m_nhanvien
        CreateTab("frmBaoCaoThongKeDocGiaNoTienPhat", "Báo cáo thống kê độc giả nợ tiền phạt", frm)
    End Sub

    Private Sub ButtonItemDocGiaSangExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemDauSachSangExcel.Click
        Dim spf As New SaveFileDialog()
        spf.Filter = "(*.xlsx)|*.xlsx"
        spf.InitialDirectory = Application.StartupPath
        spf.DefaultExt = ".xlsx"
        spf.Title = "Chọn đường dẫn để lưu"
        spf.CheckFileExists = False
        If spf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmExportExcel()
            frm.FilePath = spf.FileName
            frm.Show()
            If (frm.ExportTableToExcel("DauSach") = Windows.Forms.DialogResult.OK) Then
                frm.Dispose()
            End If
        End If
    End Sub

    Private Sub ButtonItemChuyenSachSangExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemChuyenSachSangExcel.Click
        Dim spf As New SaveFileDialog()
        spf.Filter = "(*.xlsx)|*.xlsx"
        spf.InitialDirectory = Application.StartupPath
        spf.DefaultExt = ".xlsx"
        spf.Title = "Chọn đường dẫn để lưu"
        spf.CheckFileExists = False
        If spf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmExportExcel()
            frm.FilePath = spf.FileName
            frm.Show()
            If (frm.ExportTableToExcel("Sach") = Windows.Forms.DialogResult.OK) Then
                frm.Dispose()
            End If
        End If
    End Sub

    Private Sub ButtonItemChuyenDocGiaSangExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemChuyenDocGiaSangExcel.Click
        Dim spf As New SaveFileDialog()
        spf.Filter = "(*.xlsx)|*.xlsx"
        spf.InitialDirectory = Application.StartupPath
        spf.DefaultExt = ".xlsx"
        spf.Title = "Chọn đường dẫn để lưu"
        spf.CheckFileExists = False
        If spf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmExportExcel()
            frm.FilePath = spf.FileName
            frm.Show()
            If (frm.ExportTableToExcel("DocGia") = Windows.Forms.DialogResult.OK) Then
                frm.Dispose()
            End If
        End If
    End Sub

    Private Sub ButtonItemXuatDocGia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemXuatDocGia.Click
        Dim opf As New OpenFileDialog()
        opf.Filter = "(*.xlsx)|*.xlsx"
        opf.InitialDirectory = Application.StartupPath
        opf.DefaultExt = ".xlsx"
        opf.Multiselect = False
        opf.Title = "Chọn tập tin cần phục hồi"
        opf.CheckFileExists = True
        opf.AddExtension = True
        If opf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmImportExcel()
            frm.FilePath = opf.FileName
            frm.Show()
            If frm.ImportFromExcel("DocGia") = Windows.Forms.DialogResult.OK Then
                frm.Dispose()
            End If
        End If
    End Sub

    Private Sub ButtonItemImportDauSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemImportDauSach.Click
        Dim opf As New OpenFileDialog()
        opf.Filter = "(*.xlsx)|*.xlsx"
        opf.InitialDirectory = Application.StartupPath
        opf.DefaultExt = ".xlsx"
        opf.Multiselect = False
        opf.Title = "Chọn tập tin cần phục hồi"
        opf.CheckFileExists = True
        opf.AddExtension = True
        If opf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmImportExcel()
            frm.FilePath = opf.FileName
            frm.Show()
            If frm.ImportFromExcel("DauSach") = Windows.Forms.DialogResult.OK Then
                frm.Dispose()
            End If
        End If
    End Sub

    Private Sub ButtonItemImportSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemImportSach.Click
        Dim opf As New OpenFileDialog()
        opf.Filter = "(*.xlsx)|*.xlsx"
        opf.InitialDirectory = Application.StartupPath
        opf.DefaultExt = ".xlsx"
        opf.Multiselect = False
        opf.Title = "Chọn tập tin cần phục hồi"
        opf.CheckFileExists = True
        opf.AddExtension = True
        If opf.ShowDialog() = DialogResult.OK Then
            Dim frm As New frmImportExcel()
            frm.FilePath = opf.FileName
            frm.Show()
            If frm.ImportFromExcel("Sach") = Windows.Forms.DialogResult.OK Then
                frm.Dispose()
            End If
        End If
    End Sub

    Private Sub ButtonItemGiaoDienBoPhan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemGiaoDienBoPhan.Click
        Dim frm As New frmGiaoDienBoPhan()
        CreateTab("frmGiaoDienBoPhan", "Giao diện bộ phận", frm)
    End Sub

    Private Sub ButtonItemGiaoDienQuyen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItemGiaoDienQuyen.Click
        Dim frm As New frmGiaoDienQuyen()
        CreateTab("frmGiaoDienQuyen", "Giao diện quyền", frm)
    End Sub

    Private Sub btnThongTin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThongTin.Click
        Process.Start("Help\Help.chm")
    End Sub

   
    Private Sub frmMainMenu_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.F1 Then
            Process.Start("Help\Help.chm")
        End If
    End Sub
End Class